#include "./USMART/usmart.h"
#include "./USMART/usmart_str.h"

/* -------------------------------------------- 用户配置区 -------------------------------------------- */
/* 这下面要包含所用到的函数所申明的头文件(用户自己添加) */

#include "./SYSTEM/delay/delay.h"
#include "./BSP/LCD/lcd.h"
#include "./BSP/BEEP/beep.h"
#include "./BSP/DAC/bsp_dac.h"
#include "./BSP/PWMDAC/pwmdac.h"
#include "./BSP/RS485/rs485.h"

/* -------------------------------------------- 函数名列表初始化 -------------------------------------------- */
/* 函数名列表初始化(用户自己添加)
 * 用户直接在这里输入要执行的函数名及其查找串
 */
struct _m_usmart_nametab usmart_nametab[] =
{
#if USMART_USE_WRFUNS == 1      /* 如果使能了读写操作 */
    (void *)read_addr, "uint32_t read_addr(uint32_t addr)",
    (void *)write_addr, "void write_addr(uint32_t addr,uint32_t val)",
#endif
    (void *)delay_ms, "void delay_ms(uint16_t nms)",
    (void *)delay_us, "void delay_us(uint32_t nus)",
        
    (void *)LCD_Clear, "void LCD_Clear(void)",
    (void *)LCD_Fill, "void LCD_Fill(uint16_t xsta, uint16_t ysta, uint16_t xend, uint16_t yend, uint16_t color)",
    (void *)LCD_DrawLine, "void LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)",
    (void *)Draw_Circle, "void Draw_Circle(uint16_t x0, uint16_t y0, uint8_t r, uint16_t color)",
    (void *)LCD_DrawRectangle, "void LCD_DrawRectangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)",
    
    (void *)LCD_ShowIntNum, "void LCD_ShowIntNum(uint16_t x, uint16_t y, uint16_t num, uint8_t len, uint16_t fc, uint16_t bc, uint8_t sizey)",
    (void *)LCD_ShowChar, "void LCD_ShowChar(uint16_t x, uint16_t y, uint8_t num, uint16_t fc, uint16_t bc, uint8_t sizey, uint8_t mode)",
    (void *)LCD_ShowString, "void LCD_ShowString(uint16_t x, uint16_t y, const uint8_t *p, uint16_t fc, uint16_t bc, uint8_t sizey, uint8_t mode)",
        
    (void *)beep_set_volume, "void beep_set_volume(uint8_t volume)",
    (void *)beep_set_frequency, "void beep_set_frequency(uint32_t freq)",
    
    (void *)dac_set_voltage, "void dac_set_voltage(uint8_t outx, uint16_t vol)",
    (void *)dac_set_current_4_20ma, "void dac_set_current_4_20ma(uint8_t outx, uint16_t curr)",
        
    (void *)pwmdac_set_voltage, "void pwmdac_set_voltage(uint8_t channel, uint16_t vol)",
    (void *)pwmdac_set_current_4_20ma, "void pwmdac_set_current_4_20ma(uint8_t channel, uint16_t curr)",
    
    (void *)rs485_1_send_data, "void rs485_send_data(uint8_t *buf, uint8_t len)",
};

/* -------------------------------------------- 函数控制管理器初始化 -------------------------------------------- */

/**
 * @brief       函数控制管理器初始化
 * @note        得到各个受控函数的名字
 *              得到函数总数量
 */
struct _m_usmart_dev usmart_dev =
{
    usmart_nametab,
    usmart_init,
    usmart_cmd_rec,
    usmart_exe,
    usmart_scan,
    sizeof(usmart_nametab) / sizeof(struct _m_usmart_nametab), /* 函数数量 */
    0,      /* 参数数量 */
    0,      /* 函数ID */
    1,      /* 参数显示类型,0,10进制;1,16进制 */
    0,      /* 参数类型.bitx:,0,数字;1,字符串 */
    0,      /* 每个参数的长度暂存表,需要MAX_PARM个0初始化 */
    0,      /* 函数的参数,需要PARM_LEN个0初始化 */
};
